package com.siao.example.common.ui
{
	import com.siao.display.LayoutElement;
	
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	
	/**
	 * 通用按钮
	 * @author SiaoLeon
	 */
	public class CommonButton extends LayoutElement
	{
		// -------------------------------------------------------------------------------------------------------- 静态常量
		
		// -------------------------------------------------------------------------------------------------------- 静态变量
		
		// -------------------------------------------------------------------------------------------------------- 静态方法
		
		// -------------------------------------------------------------------------------------------------------- 静态函数
		
		// -------------------------------------------------------------------------------------------------------- 属性
		
		// -------------------------------------------------------------------------------------------------------- 变量
		
		private var txtLabel:TextField;
		
		// -------------------------------------------------------------------------------------------------------- 构造
		
		/**
		 * 构造函数
		 */
		public function CommonButton(text:String="", width:Number=80, height:Number=20)
		{
			super();
			
			this.txtLabel = new TextField();
			this.txtLabel.autoSize = TextFieldAutoSize.CENTER;
			this.txtLabel.text = text;
			this.txtLabel.x = (width - this.txtLabel.width) / 2;
			this.txtLabel.y = (height - this.txtLabel.height) / 2;
			this.addChild(this.txtLabel);
			
			this.mouseChildren = false;
			this.mouseEnabled = true;
			this.buttonMode = true;
			
			this.width = width;
			this.height = height;
			
			this.draw(0X000000, 0.4);
		}
	
		// -------------------------------------------------------------------------------------------------------- 方法
	
		// -------------------------------------------------------------------------------------------------------- 函数
	
	}
}
